<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>跳转</title>
		<script src="vendor/jquery/jquery-3.2.1.min.js"></script>

		<script type="text/javascript" charset="utf-8" src="https://connect.qq.com/qc_jssdk.js" data-appid="101853320"
		 data-redirecturi="https://www.zoupk.top/moguding/index.html"></script>

	</head>
	<body>

		<div class="qqlogin"></div>
	</body>
<script src="js/app.js"></script>
	<script>
		// 获取地址栏上的code qq 登录 
		QC.Login.getMe(function(openId, accessToken) {

		// 查询数据库有没有这个ID 有的话直接进入主页
		
		$.ajax({
			//请求方式
			type: "POST",
			//请求的媒体类型
			//请求地址
			url: app.serviceurl + "qqlogin",
			xhrFields: {
				withCredentials: true
			},
			data: {code:openId},
			//请求成功
			success: function(result) {
				if (result.status == 0) {
					//
					window.location.href = "login.html";
				}else if(result.status == 1){ 
					window.location.href = "index.html";
				}else if(result.status == 2){ 
					alert("绑定账号")
				}
		
			},
			//请求失败，包含具体的错误信息
			error: function(e) {
				console.log(e);
		
			}
		});
		
		

		})
	</script>


</html>
